Optimal. Leaf size=81 \[ \frac{1}{8} x \left (3 a^2+8 a b+8 b^2\right )+\frac{3 a (a+2 b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac{a \sin (e+f x) \cos ^3(e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{4 f} \]
[Out]
________________________________________________________________________________________
Rubi [A] time = 0.0863722, antiderivative size = 81, normalized size of antiderivative = 1., number of steps used = 4, number of rules used = 4, integrand size = 23, \(\frac{\text{number of rules}}{\text{integrand size}}\) = 0.174, Rules used = {4146, 413, 385, 203} \[ \frac{1}{8} x \left (3 a^2+8 a b+8 b^2\right )+\frac{3 a (a+2 b) \sin (e+f x) \cos (e+f x)}{8 f}+\frac{a \sin (e+f x) \cos ^3(e+f x) \left (a+b \tan ^2(e+f x)+b\right )}{4 f} \]
Antiderivative was successfully verified.
[In]
[Out]
Rule 4146
Rule 413
Rule 385
Rule 203
Rubi steps
\begin{align*} \int \cos ^4(e+f x) \left (a+b \sec ^2(e+f x)\right )^2 \, dx &=\frac{\operatorname{Subst}\left (\int \frac{\left (a+b+b x^2\right )^2}{\left (1+x^2\right )^3} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac{a \cos ^3(e+f x) \sin (e+f x) \left (a+b+b \tan ^2(e+f x)\right )}{4 f}+\frac{\operatorname{Subst}\left (\int \frac{(a+b) (3 a+4 b)+b (a+4 b) x^2}{\left (1+x^2\right )^2} \, dx,x,\tan (e+f x)\right )}{4 f}\\ &=\frac{3 a (a+2 b) \cos (e+f x) \sin (e+f x)}{8 f}+\frac{a \cos ^3(e+f x) \sin (e+f x) \left (a+b+b \tan ^2(e+f x)\right )}{4 f}+\frac{\left (3 a^2+8 a b+8 b^2\right ) \operatorname{Subst}\left (\int \frac{1}{1+x^2} \, dx,x,\tan (e+f x)\right )}{8 f}\\ &=\frac{1}{8} \left (3 a^2+8 a b+8 b^2\right ) x+\frac{3 a (a+2 b) \cos (e+f x) \sin (e+f x)}{8 f}+\frac{a \cos ^3(e+f x) \sin (e+f x) \left (a+b+b \tan ^2(e+f x)\right )}{4 f}\\ \end{align*}
Mathematica [A] time = 0.12574, size = 58, normalized size = 0.72 \[ \frac{4 \left (3 a^2+8 a b+8 b^2\right ) (e+f x)+a^2 \sin (4 (e+f x))+8 a (a+2 b) \sin (2 (e+f x))}{32 f} \]
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A] time = 0.057, size = 78, normalized size = 1. \begin{align*}{\frac{1}{f} \left ({a}^{2} \left ({\frac{\sin \left ( fx+e \right ) }{4} \left ( \left ( \cos \left ( fx+e \right ) \right ) ^{3}+{\frac{3\,\cos \left ( fx+e \right ) }{2}} \right ) }+{\frac{3\,fx}{8}}+{\frac{3\,e}{8}} \right ) +2\,ab \left ( 1/2\,\sin \left ( fx+e \right ) \cos \left ( fx+e \right ) +1/2\,fx+e/2 \right ) +{b}^{2} \left ( fx+e \right ) \right ) } \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A] time = 1.47088, size = 117, normalized size = 1.44 \begin{align*} \frac{{\left (3 \, a^{2} + 8 \, a b + 8 \, b^{2}\right )}{\left (f x + e\right )} + \frac{{\left (3 \, a^{2} + 8 \, a b\right )} \tan \left (f x + e\right )^{3} +{\left (5 \, a^{2} + 8 \, a b\right )} \tan \left (f x + e\right )}{\tan \left (f x + e\right )^{4} + 2 \, \tan \left (f x + e\right )^{2} + 1}}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A] time = 0.490376, size = 143, normalized size = 1.77 \begin{align*} \frac{{\left (3 \, a^{2} + 8 \, a b + 8 \, b^{2}\right )} f x +{\left (2 \, a^{2} \cos \left (f x + e\right )^{3} +{\left (3 \, a^{2} + 8 \, a b\right )} \cos \left (f x + e\right )\right )} \sin \left (f x + e\right )}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [F(-1)] time = 0., size = 0, normalized size = 0. \begin{align*} \text{Timed out} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A] time = 1.33873, size = 126, normalized size = 1.56 \begin{align*} \frac{{\left (3 \, a^{2} + 8 \, a b + 8 \, b^{2}\right )}{\left (f x + e\right )} + \frac{3 \, a^{2} \tan \left (f x + e\right )^{3} + 8 \, a b \tan \left (f x + e\right )^{3} + 5 \, a^{2} \tan \left (f x + e\right ) + 8 \, a b \tan \left (f x + e\right )}{{\left (\tan \left (f x + e\right )^{2} + 1\right )}^{2}}}{8 \, f} \end{align*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]